module top_module (
	input clk,
	input L,
	input r_in,
	input q_in,
	output reg Q);
    
    wire mul_out;
    always @(posedge clk) begin
        Q <= mul_out;
    end
    assign mul_out = L?r_in:q_in;

endmodule